<template>
  <div>
    <el-form
      :form="form"
      @on-click="handleSubmit"
    ></el-form>
  </div>
</template>
<script>
import elForm from "../form/search";
export default {
  components: {
    elForm
  },
  data() {
    return {
      params: {
        limit: 10,
        page: 1
      },
      form: [
        {
          type: "input",
          placeholder: "商品名称",
          label: "name"
        },
        {
          type: "select",
          label: "state",
          options: [{ title: "上架", id: 1 }, { title: "下架", id: 0 }]
        }
      ]
    };
  },
  mounted() {
    this.getData();
  },
  methods: {
    // 通用 获取数据
    getData() {
      //
      console.log(this.$route.path);
    },
    handleSubmit(data) {
      this.params = {
        ...this.params,
        ...data
      };
      this.getData();
    }
  }
};
</script>

